﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BLL
{
    using System.Data;

    public class    HocviBLL : DAL.HocviDAL
    {

        private string AddID(string id)
        {
            string s = id.Trim(); // bn01

            int len = s.Length;
            string con = s.Substring(2); // 01
            string kq = s.Substring(0, 2); // bn
            int so = Convert.ToInt32(con) + 1;
            if (so <= 9)
                kq += '0';
            kq += so;

            return kq;
        }

        public string CreateID()
        {
            string result = Select_max().Trim();
            //if (result.Length > 2)
            //{
            //    result = result.Substring(2);
            //}
            //else result = "";

            Int32 i =0;
            i = Convert.ToInt32(result);
            i++;

            
            return "HV" +i.ToString("0#");
           
        }

    }
}
